﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using KCMS.Areas.Admin.Engine;

namespace KCMS.Areas.Admin.Controllers
{
    public class HelpController : Controller
    {
        //
        // GET: /Admin/Help/

        public JsonResult GenerateCode(String title)
        {
            try
            {
                CodeGenerator generator = new CodeGenerator();
                var code = generator.getCode(title);
                return Json(new { code = code }, JsonRequestBehavior.AllowGet);
            }
            catch
            {
                return Json(new { code = "" }, JsonRequestBehavior.AllowGet);
            }
        }
    }
}
